package cn.org.eshow.service;

import cn.org.eshow.bean.query.MoneyQuery;
import cn.org.eshow.common.page.Page;
import cn.org.eshow.model.Money;
import cn.org.eshow.model.User;
import cn.org.eshow.model.Withdraw;

import javax.jws.WebService;
import java.util.List;

/**
 *
 */
@WebService
public interface MoneyManager extends GenericManager<Money, Integer> {

    /**
     * @param query
     * @return
     */
    List<Money> list(MoneyQuery query);

    /**
     * @param query
     * @return
     */
    Page<Money> search(MoneyQuery query);

    /**
     * 获取我的账户信息
     *
     * @param user
     * @return
     */
    Money mine(User user);

    /**
     * @param query
     * @return
     */
    Money check(MoneyQuery query);

    /**
     * 改变用户余额信息
     *
     * @param money
     * @param amount 增加的账户余额
     * @return
     */
    Money balance(Money money, Double amount);

    /**
     * 更新用户账户信息
     *
     * @param old
     * @param money
     * @return
     */
    Money update(Money old, Money money);


    /**
     * 冻结 用户账户信息
     * @param money
     * @param amount
     * @return
     */
    Money frozen(Money money, Double amount);

    /**
     * 提现中金额增加
     * @param money
     * @param amount
     * @return
     */
    Money withdrawing(Money money, Double amount);

    /**
     * 已提现金额增加
     * @param money
     * @param amount
     * @return
     */
    Money withdraw(Money money, Double amount);

    /**
     * 提交 提现申请(0.balance余额减少  1.提现中withdrawing金额增加 2生成bill )
     *
     * @param money
     * @param withdraw
     * @return
     */
    Boolean withdraw(Money money, Withdraw withdraw);



}